![]() |
OPC-UA Embedded Server SDK
2.0.4
|
Data Structures | |
| struct | UA_UTF8_string_t |
| Represents a UTF8 string for translation of human readable text. More... | |
| struct | UA_Byte_string_t |
| Represents a variable length byte string. More... | |
| union | UA_Value_t |
| The valid pointer types for a read or write operation by the stack on host maintained variables (node value attributes) via read and write callbacks. More... | |
| struct | UA_Configuration_BuildInfo_t |
| The configuration structure for the UA Server BuildInfo object. More... | |
| struct | UA_Configuration_TcpBinary_t |
| The configuration structure for the UA Server TCP Binary Layer. More... | |
| struct | UA_Configuration_SecureConversation_t |
| The configuration structure for the UA Server Secure Conversation Layer. More... | |
| struct | UA_Configuration_Security_t |
| The configuration structure for the UA Server Security Policies. More... | |
| struct | UA_Configuration_Intervals_t |
| The configuration structure for the Server Intervals. More... | |
| struct | UA_Configuration_Services_t |
| The configuration structure for the UA Server Services. More... | |
| struct | UA_Configuration_NamespaceArray_t |
| The configuration structure for the Namespace Array. More... | |
| struct | UA_Configuration_AddressSpace_t |
| The configuration structure for the UA Server Address Space. More... | |
| struct | UA_Configuration_CertManagement_t |
| The configuration structure for the UA Server Certificate Management. More... | |
| struct | UA_Configuration_Locales_t |
| The configuration structure for the UA Server Locale Handling. More... | |
| struct | UA_Configuration_ProfileArray_t |
| The configuration structure for the UA Server Profile Array. More... | |
| struct | UA_Configuration_OperationLimits_t |
| The configuration structure for the UA Server Operation Limits object. More... | |
| struct | UA_Configuration_ServerCapabilities_t |
| The configuration structure for the UA Server Capabilities object. More... | |
| struct | UA_Configuration_Internals_t |
| The configuration structure for the UA Server miscellaneous internals. More... | |
| struct | UA_Configuration_Diagnostics_t |
| The configuration structure for the UA Server diagnostics. More... | |
| struct | UA_Configuration_Filters_t |
| The configuration structure for the UA Server Filters. More... | |
| struct | UA_Configuration_t |
| The configuration structure for the UA Server. More... | |
| struct | UA_NodeId_Config_t |
| Optionally specifies a non-opaque node id for an address space node. More... | |
| struct | UA_Base_t |
| A configuration structure for all address space nodes. More... | |
| struct | UA_File_t |
| A configuration structure for Method address space nodes. More... | |
| struct | UA_Method_t |
| A configuration structure for File address space nodes. More... | |
| struct | UA_BaseDataVariable_t |
| A configuration structure for BaseDataVariable address space nodes. More... | |
| struct | UA_DataItem_t |
| A configuration structure for DataItem address space nodes. More... | |
| struct | UA_Range_t |
| Range data type. More... | |
| struct | UA_EUInformation_t |
| Engineering Units configuration (see user manual for description) More... | |
| struct | UA_AnalogItem_t |
| A configuration structure for AnalogItem address space nodes. More... | |
| struct | UA_TwoStateDiscrete_t |
| A configuration structure for TwoStateDiscrete address space nodes. More... | |
| struct | UA_MultiStateDiscrete_t |
| A configuration structure for MultiStateDiscrete address space nodes. More... | |
Typedefs | |
| typedef uint32_t | UA_Status_t |
| Represents an OPC-UA status code. More... | |
| typedef UA_Byte_string_t | UA_Xml_element_t |
| A structure representing XMLElement values. More... | |
| typedef UA_Byte_string_t | UA_Var_string_t |
| A structure representing UTF8 string values. More... | |
| typedef uint8_t * | UA_GUID_t |
| Represents a GUID as a pointer to an array of 16 bytes. More... | |
| typedef UA_Base_t | UA_Folder_t |
| A configuration structure for Folder address space nodes. More... | |
| typedef UA_Folder_t | UA_View_t |
| A configuration structure for View address space nodes. More... | |
| #define UA_SDK_SOFTWARE_VERSION "MatrikonOPC OPC-UA Embedded Server SDK Version 2.0.4" |
SDK Software Version String (Do not change)
Definition at line 23 of file ua_server_config_template.h.
| #define UA_MAX_ALIGNMENT 8 |
SDK License description (Do not change)
Definition at line 29 of file ua_server_config_template.h.
| #define UA_BIG_ENDIAN 0 |
Endianess of target Set to 0 for little endian and 1 for big endian
Definition at line 37 of file ua_server_config_template.h.
| #define UA_CROSS_ENDIAN_DOUBLE 0 |
Endianess of target floating point unit Set to 1 for cross endian double or 0 for everything else
Definition at line 45 of file ua_server_config_template.h.
| #define UA_INCLUDE_SUBSCRIPTIONS 1 |
Support Subscriptions and Monitored Items Set to 0 for no support, 1 for support
Definition at line 53 of file ua_server_config_template.h.
| #define UA_INCLUDE_MON_ITEM_TRIGGERING 1 |
Support Monitored Item Triggering Set to 0 for no support, 1 for support
Definition at line 61 of file ua_server_config_template.h.
| #define UA_INCLUDE_STANDARD_ADDRESS_SPACE 1 |
Include standard type information in address space Set to 0 to omit, 1 to include
Definition at line 69 of file ua_server_config_template.h.
| #define UA_OVERLOAD_NEW_AND_DELETE 0 |
Include empty implementations of new and delete Set to 0 to omit, 1 to include
Definition at line 77 of file ua_server_config_template.h.
| #define UA_INCLUDE_CPP_STD_LIB_DEPS 0 |
Include C++ standard library dependencies Set to 0 to omit, 1 to include
Definition at line 85 of file ua_server_config_template.h.
| #define UA_NO_THROW throw() |
Some compilers do not allow throw() when exceptions are disabled. Altering this setting may cause hard faults on your platform in low memory conditions. Do not alter without consulting support@matrikonopc.com.
Definition at line 94 of file ua_server_config_template.h.
| #define UA_STANDARD_NODES_SECTION_ATTRIBUTE_PREFIX |
Support placement of standard nodes in a specific data section Leave empty for default linker behaviour
Definition at line 102 of file ua_server_config_template.h.
| #define UA_STANDARD_NODES_SECTION_ATTRIBUTE_POSTFIX |
Support placement of standard nodes in a specific data section Leave empty for default linker behaviour
Definition at line 110 of file ua_server_config_template.h.
| #define UA_INCLUDE_APP_DEFINED_NODE_IDS 0 |
Support application defined Node Ids (string or GUID types) Set to 0 for no support, 1 for support
Definition at line 118 of file ua_server_config_template.h.
| #define UA_USE_OPENSSL 0 |
Support security Set to 0 for no support, 1 for supportUse OpenSSL security implementation Set to 0 for no support, 1 for support
Definition at line 134 of file ua_server_config_template.h.
| #define UA_USE_MATRIXSSL 0 |
Use MatrixSSL security implementation Set to 0 for no support, 1 for support
Definition at line 142 of file ua_server_config_template.h.
| #define UA_MATRIXSSL_SUPPORT_SECURITY_POLICY_BASIC256 0 |
Support SecurityPolicy Basic 256 with MatrixSSL. This feature requires MatrixSSL components not included in the openly available GPL version. While testing MatrixSSL in advance of a purchase set this macro to 0 to enable compilation. Set to 0 for no support, 1 for support
Definition at line 153 of file ua_server_config_template.h.
| #define UA_MATRIXSSL_SUPPORT_CERTIFICATE_GENERATION 0 |
Support MatrixSSL certificate generation. This feature requires MatrixSSL components not included in the openly available GPL version. While testing MatrixSSL in advance of a purchase set this macro to 0 to enable compilation. Set to 0 for no support, 1 for support
Definition at line 164 of file ua_server_config_template.h.
| #define APPLICATION_RSA_KEY_LENGTH 1024 |
Generated Certificate key length. Only used when security is included Set to 1024 or 2048 bits
Definition at line 172 of file ua_server_config_template.h.
| #define UA_INCLUDE_READ_DEFERRALS 0 |
Support file transfer methods Set to 0 for no support, 1 for supportSupport deferral of read operations Set to 0 for no support, 1 for support
Definition at line 188 of file ua_server_config_template.h.
| #define UA_INCLUDE_ASYNC_OPS 0 |
Support asynchronous operations Set to 0 for no support, 1 for support
Definition at line 196 of file ua_server_config_template.h.
| #define UA_MUTEX_T void |
If including asynchronous operations define the platform mutex type here. Otherwise just set it to void.
Definition at line 204 of file ua_server_config_template.h.
| #define ALLOW_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE 0 |
Allow user certificates with no signing (major security risk) Set to 0 for no support, 1 for support
Definition at line 212 of file ua_server_config_template.h.
| #define UA_PRODUCT_URI "PRODUCT_URI" |
The configuration for the UA Server BuildInfo object.
Product URI for BuildInfo Standard Node
Definition at line 220 of file ua_server_config_template.h.
| #define UA_PRODUCT_NAME "PRODUCT_NAME" |
Product name for BuildInfo Standard Node
Definition at line 222 of file ua_server_config_template.h.
| #define UA_MANUFACTURER_NAME "MANUFACTURER_NAME" |
Manufacturer name for BuildInfo Standard Node
Definition at line 224 of file ua_server_config_template.h.
| #define UA_SOFTWARE_VERSION "SOFTWARE_VERSION" |
Software version for BuildInfo Standard Node
Definition at line 226 of file ua_server_config_template.h.
| #define UA_BUILD_NUMBER "BUILD_NUMBER" |
Build number for BuildInfo Standard Node
Definition at line 228 of file ua_server_config_template.h.
| #define UA_BUILD_DATE 0 |
Build date (Windows FileTime format) for BuildInfo Standard Node
Definition at line 230 of file ua_server_config_template.h.
| #define UA_USER_TOKEN_POLICY_ANONYMOUS_TOKEN_SECURITY_POLICY_NONE (1<<0) |
Bit definitions for the UA Server Security Configuration bitmaps.
User Token Anonymous - Token Security Policy None
Definition at line 354 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_NONE (1<<1) |
User Token Username / Password - Token Security Policy None
Definition at line 357 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic128Rsa15 (1<<2) |
User Token Username / Password - Token Security Policy Basic128Rsa15
Definition at line 359 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256 (1<<3) |
User Token Username / Password - Token Security Policy Basic256
Definition at line 361 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_USERNAME_PASSWORD_TOKEN_SECURITY_POLICY_Basic256Sha256 (1<<4) |
User Token Username / Password - Token Security Policy Basic256Sha256
Definition at line 363 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_NONE (1<<5) |
User Token X509v3 Certificate - Token Security Policy None
Definition at line 366 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic128Rsa15 (1<<6) |
User Token X509v3 Certificate - Token Security Policy Basic128Rsa15
Definition at line 368 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256 (1<<7) |
User Token X509v3 Certificate - Token Security Policy Basic256
Definition at line 370 of file ua_types.h.
| #define UA_USER_TOKEN_POLICY_X509v3_CERTIFICATE_TOKEN_SECURITY_POLICY_Basic256Sha256 (1<<8) |
User Token X509v3 Certificate - Token Security Policy Basic256Sha256
Definition at line 372 of file ua_types.h.
| #define OB_SUPPRESS_CERTIFICATE_EXPIRED (1<<0) |
Bit definitions for a bitmap that allows you to modify the behaviour of the OPC UA Secure Channel Client Certificate handling.
Option Bit - Accept expired certificates
Definition at line 1026 of file ua_types.h.
| #define OB_SUPPRESS_HOSTNAME_INVALID (1<<1) |
Option Bit - Do not validate the application hostname
Definition at line 1028 of file ua_types.h.
| #define OB_SUPPRESS_REVOCATION_STATUS_UNKNOWN (1<<2) |
Option Bit - If checking certificate CRLs do not reject a certificate if a CRL for the Issuer cannot be found
Definition at line 1031 of file ua_types.h.
| #define OB_CHECK_REVOCATION_STATUS_ONLINE (1<<3) |
Option Bit - Look for CRLs online (not currently supported)
Definition at line 1033 of file ua_types.h.
| #define OB_CHECK_REVOCATION_STATUS_OFFLINE (1<<4) |
Option Bit - Look for CRLs locally (typically in the local filesystem
Definition at line 1035 of file ua_types.h.
| #define OB_USE_DEFAULT_OPTIONS (1<<5) |
Option Bit - Use default options for the PKI provider
Definition at line 1037 of file ua_types.h.
| #define OB_TRUST_ALL_CLIENTS_WHEN_TRUST_LIST_IS_EMPTY (1U<<31) |
Option Bit - Trust all client certificates if the trust list is empty
Definition at line 1039 of file ua_types.h.
| typedef uint32_t UA_Status_t |
Represents an OPC-UA status code.
OPC-UA status codes are defined in opcua_status_codes.h
Definition at line 151 of file ua_types.h.
| typedef UA_Byte_string_t UA_Xml_element_t |
A structure representing XMLElement values.
Definition at line 186 of file ua_types.h.
| typedef UA_Byte_string_t UA_Var_string_t |
A structure representing UTF8 string values.
Definition at line 192 of file ua_types.h.
| typedef uint8_t* UA_GUID_t |
Represents a GUID as a pointer to an array of 16 bytes.
As an example, GUID “72962B91-FA75-4AE6-8D28-B404DC7DAF63” should be encoded as follows:
Data1 Data2 Data3 Data4 91 2B 96 72 75 FA E6 4A 8D 28 B4 04 DC 7D AF 63
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Definition at line 205 of file ua_types.h.
| typedef UA_Base_t UA_Folder_t |
A configuration structure for Folder address space nodes.
Definition at line 734 of file ua_types.h.
| typedef UA_Folder_t UA_View_t |
A configuration structure for View address space nodes.
Definition at line 740 of file ua_types.h.
| enum UA_Value_type_t |
Enumeration of value data types that can be stored in a variable node
Definition at line 55 of file ua_types.h.
| enum UA_Server_state_t |
Enumeration of server state.
API functions exist to read and write server state. When shutting down the server, the shutdown takes 60 seconds to allow clients an opportunity to disconnect.
Definition at line 94 of file ua_types.h.
| enum UA_Log_severity_t |
Enumeration of log message severity.
UAServer_Log_callback() flags the severity of the log message with this type.
| Enumerator | |
|---|---|
| UA_LOG_SEVERITY_ERROR |
Error |
| UA_LOG_SEVERITY_INFO |
Info |
Definition at line 113 of file ua_types.h.
| enum UA_Log_payload_t |
Enumeration of log message data payload type.
UAServer_Log_callback() describes the format of the optional log data payload with this type.
| Enumerator | |
|---|---|
| UA_LOG_PAYLOAD_NONE |
No data payload |
| UA_LOG_PAYLOAD_CSTRING |
String payload |
| UA_LOG_PAYLOAD_BINARY |
Binary payload |
Definition at line 126 of file ua_types.h.
Enumeration of monitored item callabck operation type.
UAServer_Callback_monitored_item() uses this type.
| Enumerator | |
|---|---|
| UA_MON_ITEM_CREATED |
A monitored item was created |
| UA_MON_ITEM_MODIFIED |
A monitored item was modified |
| UA_MON_ITEM_DESTROYED |
A monitored item was destroyed |
Definition at line 139 of file ua_types.h.
Node id encoding types for an address space node.
| Enumerator | |
|---|---|
| opcua_node_encoding_numeric |
Numeric |
| opcua_node_encoding_string |
String |
| opcua_node_encoding_guid |
GUID |
| opcua_node_encoding_bytestring |
Opaque |
Definition at line 645 of file ua_types.h.
| enum UA_Asym_Cipher_t |
Enumeration of asymmetric cipher types.
| Enumerator | |
|---|---|
| UA_ASYM_CIPHER_INVALID |
Invalid |
| UA_ASYM_CIPHER_RSA_PKCS1_v1_5 |
RSA-1_5 |
| UA_ASYM_CIPHER_RSA_OAEP |
RSA OAEP (SHA1) |
Definition at line 963 of file ua_types.h.
| enum UA_Sym_Cipher_t |
Enumeration of symmetric cipher types.
| Enumerator | |
|---|---|
| UA_SYM_CIPHER_INVALID |
invalid |
| UA_SYM_CIPHER_AES_128_CBC |
AES 128 CBC |
| UA_SYM_CIPHER_AES_256_CBC |
AES 256 CBC |
Definition at line 974 of file ua_types.h.
| enum UA_Digest_t |
Enumeration of message digest types.
| Enumerator | |
|---|---|
| UA_DIGEST_INVALID |
Invalid |
| UA_DIGEST_SHA1 |
SHA1 |
| UA_DIGEST_SHA256 |
SHA256 |
Definition at line 985 of file ua_types.h.
| enum UA_Security_policy_t |
Enumeration of message security policies.
Definition at line 996 of file ua_types.h.
Enumeration of X509 certificate types.
Definition at line 1009 of file ua_types.h.
| uint32_t UAServer_Callback_millisecond | ( | void | ) |
Function provided by host to enable library to time its internal operations
The library requires a millisecond timer in order to operate. This timer is implemented via a uint32_t which increments every millisecond. The host must implement this function as it is called periodically by the stack.
| uint32_t UAServer_Callback_pseudeo_random_number | ( | void | ) |
Function provided by host to provide pseudo-random numbers
The library requires a pseudo-random number generator in order to operate. The host must implement this function as it is called periodically by the library.
| void* UAServer_Callback_memcpy | ( | void * | destination, |
| const void * | source, | ||
| size_t | num | ||
| ) |
Function provided by host to provide a memcpy implementation
Some platforms can dramatically improve the performance of memcpy for large data blocks by using DMA or other techniques. If required, a custom implementation may be inserted here. Where a custom implementation is not required simply call the standard library implementation.
| [in] | destination | Pointer to the destination array where the content is to be copied, type-casted to a pointer of type void*. |
| [in] | source | Pointer to the source of data to be copied, type-casted to a pointer of type const void*. |
| [in] | num | Number of bytes to copy. size_t is an unsigned integral type. |
| void* UAServer_Callback_memchr | ( | const void * | ptr, |
| int32_t | value, | ||
| size_t | num | ||
| ) |
Function provided by host to provide a memchr implementation
Simply call the standard library implementation.
| [in] | ptr | Pointer to the block of memory where the search is performed. |
| [in] | value | Value to be located. The value is passed as an int, but the function performs a byte per byte search using the unsigned char conversion of this value. |
| [in] | num | Number of bytes to be analyzed. size_t is an unsigned integral type. |
| void* UAServer_Callback_memset | ( | void * | ptr, |
| int32_t | value, | ||
| size_t | num | ||
| ) |
Function provided by host to provide a memset implementation
Simply call the standard library implementation.
| [in] | ptr | Pointer to the block of memory to fill. |
| [in] | value | Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value. |
| [in] | num | Number of bytes to be set to the value. size_t is an unsigned integral type. |
| int UAServer_Callback_memcmp | ( | const void * | ptr1, |
| const void * | ptr2, | ||
| size_t | num | ||
| ) |
Function provided by host to provide a memcmp implementation
Simply call the standard library implementation.
| [in] | ptr1 | Pointer to block of memory. |
| [in] | ptr2 | Pointer to block of memory. |
| [in] | num | Number of bytes to compare. |
| char* UAServer_Callback_strncpy | ( | char * | destination, |
| const char * | source, | ||
| size_t | num | ||
| ) |
Function provided by host to provide a strncpy implementation
Simply call the standard library implementation.
| [in] | destination | Pointer to the destination array where the content is to be copied. |
| [in] | source | C string to be copied. |
| [in] | num | Maximum number of characters to be copied from source. size_t is an unsigned integral type. |
| void* UAServer_Callback_malloc | ( | size_t | size | ) |
Function provided by host to provide a malloc implementation
Simply call the standard library implementation.
| [in] | size | Size of the memory block, in bytes. size_t is an unsigned integral type. |
| void UAServer_Callback_free | ( | void * | ptr | ) |
Function provided by host to provide a free implementation
Simply call the standard library implementation.
| [in] | ptr | Pointer to a memory block previously allocated with malloc, calloc or realloc. |
| int64_t UAServer_Callback_datetime | ( | void | ) |
Function provided by host to enable library to obtain current date and time
The library requires the current date and time in order to operate. This timer is implemented via an int64_t which represents UTC time and data in accordance with Windows FILETIME. This is the number of 100ns intervals since January 1, 1601. The host must implement this function as it is called periodically by the library.
| void UAServer_Callback_read | ( | uint32_t | node_handle, |
| UA_Value_type_t | value_type, | ||
| uint32_t | max_array_length, | ||
| uintptr_t | read_context | ||
| ) |
Function provided by host to enable library to read values
The library requires the ability to read values from the host system in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library and the implemented function must call UA_Perform_read() in order to perform the actual read operation.
| [in] | node_handle | A unique identifier that the host can use to efficiently look up the value. |
| [in] | value_type | In order to keep the API lean, this function returns the variable to the library via a non type safe void pointer. The value_type parameter provides run-time type safety by specifying the data type the library expects for the value attribute of the node and allowing the host to verify this against the node handle provided by the library. |
| [in] | max_array_length | Similar to the value_type parameter, the max_array_length parameter facilitates run-time type safety by specifying the max array length the library expects for the provided pointer allowing the host to verify this against the node handle provided by the library. |
| [in] | read_context | A pointer to an opaque data structure providing context to the pending read operation. The host must pass this pointer to UA_Perform_read(). |
| UA_Status_t UAServer_Perform_read | ( | uintptr_t | read_context, |
| UA_Value_t | data_value, | ||
| int64_t | source_timestamp, | ||
| UA_Status_t | status_code | ||
| ) |
Performs a read operation
The host calls this function from UA_Read_callback() to perform a read on the requested node.
| [in] | read_context | A pointer to an opaque data structure providing context to the pending read operation. The user must pass this pointer to UA_Perform_read(). |
| [in] | data_value | A pointer to the value required to be read by the library or 0 if the input parameters failed verification or the value is not readable. The value would not be readable if the host system's connection to the underlying data source was unavailable. In this case the host may decide to simply return the most recent cached value (with a corresponding old timestamp) or may return 0 in order to indicate that the data cannot be read. |
| [in] | source_timestamp | Each time the host value is updated by the host, the host should timestamp the update. This timestamp is provided to the library via this parameter and communicated to the client in the DataValue structure. |
| [in] | status_code | For Data Access variable types the user must provide a data quality status code to inform the client as to the status of the data read. For base data variable calls this value is ignored by the library and the server returns Bad_NotReadable if the call provides a 0 data_value pointer. For Data Access variables it is expected that the user will write the correct data quality value into this parameter on every call. For some systems only a couple of the available values may be relevant and in this case it is not necessary to use them all. |
| bool_t UAServer_Is_read_operation_asynchronous | ( | uintptr_t | read_context | ) |
Is the current read callback invoked due to an asynchronous read request or a monitored item sample?
This function can only be called from UAServer_Callback_read().
| [in] | read_context | The read context provided by the SDK. |
| bool_t UAServer_Is_read_operation_deferrable | ( | uintptr_t | read_context | ) |
Can the current read operation be deferred if we have to obtain the data value from a slow remote data source?
This function can only be called from UAServer_Callback_read().
| [in] | read_context | The read context provided by the SDK. |
| bool_t UAServer_Is_read_operation_deferred | ( | uintptr_t | read_context | ) |
Is the current read operation a repeat of an operation that was previously deferred?
This function can only be called from UAServer_Callback_read().
| [in] | read_context | The read context provided by the SDK. |
| UA_Status_t UAServer_Defer_read_operation | ( | uintptr_t | read_context, |
| uintptr_t * | deferral_handle | ||
| ) |
Defer the current read operation as we have to obtain the data from a slow remote data source and doing so synchronously would degrade server response for all connected clients.
This function can only be called from UAServer_Callback_read().
| [in] | read_context | The read context provided by the SDK. |
| [out] | deferral_handle | A unique handle representing this specific deferral. |
| UA_Status_t UAServer_Read_deferral_complete | ( | uintptr_t | deferral_handle, |
| UA_Status_t | status_code | ||
| ) |
The read deferral is complete.
The application notifies the SDK that the data has been obtained from the data source and is now available for reading. After making this call the SDK will immediately call UAServer_Callback_read() again. This function must NOT be called from any server callback function.
| [in] | deferral_handle | The deferral handle provided by the SDK. |
| [out] | status_code | The result of the asynchronous read operation. |
| void UAServer_Callback_deferred_read_operation_aborted | ( | uintptr_t | deferral_handle | ) |
The deferred read operation is aborted.
The application has previously deferred a read operation and received a deferral handle for the deferred read. This call indicates that the deferral operation has been cancelled by the SDK. This could be due to the client closing the session that the read operation is associated with. After receiving this callback the application must NOT call UAServer_Read_deferral_complete() with this deferral handle as this will result in the SDK dereferencing a free'd pointer.
| [in] | deferral_handle | The deferral handle provided by the SDK. |
| void UAServer_Callback_write | ( | uint32_t | node_handle, |
| UA_Value_type_t | value_type, | ||
| UA_Status_t | status_code, | ||
| uint32_t | max_array_length, | ||
| uintptr_t | write_context | ||
| ) |
Function provided by host to enable library to write values
The library requires the ability to write values from the host system in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library and the implemented function must call UA_Perform_write() in order to perform the actual write operation.
| [in] | node_handle | A unique identifier that the host can use to efficiently look up the value. |
| [in] | value_type | In order to keep the API lean, this function returns the variable to the library via a non type safe void pointer. The value_type parameter provides run-time type safety by specifying the data type the library expects for the value attribute of the node and allowing the host to verify this against the node handle provided by the library. |
| [in] | status_code | The status_code for the value written by the client. |
| [in] | max_array_length | Similar to the value_type parameter, the max_array_length parameter facilitates run-time type safety by specifying the max array length the library expects for the provided pointer allowing the host to verify this against the node handle provided by the library. |
| [in] | write_context | A pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write(). |
| UA_Status_t UAServer_Perform_write | ( | uintptr_t | write_context, |
| UA_Value_t | data_value, | ||
| int64_t * | source_timestamp, | ||
| bool_t | completes_asynchronously, | ||
| uint32_t * | new_length_of_array | ||
| ) |
Performs a write operation
The host calls this function from UA_Write_callback() to perform a write on the requested node.
| [in] | write_context | A pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write(). |
| [in] | data_value | A pointer to the value required to be written by the library or 0 if the input parameters failed verification or the value is not writable. The value would not be writable if the host system's connection to the underlying data source was unavailable. In this case the host may decide to simply provide the most recent cached value (with a corresponding old timestamp) or may provide 0 in order to indicate that the data cannot be written. |
| [in] | source_timestamp | The timestamp for the value when written by the client. This may be modified by the library during the write if the client specified a source timestamp. |
| [in] | completes_asynchronously | If the write to the underlying system completes asynchronously then this flag should be set. Alternatively if the write to the underlying system completes before the completion of UAServer_Write_callback() this flag should be cleared. The flag affects the result code the library returns to the OPC-UA Client. If the call succeeds and the flag is set the write operation level result is OpcUa_GoodCompletesAsynchronously. if the write succeeds and the flag is not set the write operation level result code is OpcUA_Good. |
| [out] | new_length_of_array | When a client writes to the value attribute of a node containing an array, the client can change the length of the array by writing a complete array that is shorter than the maximum array length. This parameter informs the host what the new array length is after the write in case this information is of interest. |
| void UAServer_Set_write_operation_level_result_code | ( | uintptr_t | write_context, |
| UA_Status_t | result_code | ||
| ) |
Sets the result code of a write operation
The host can optionally call this function from UA_Write_callback() to revise the result code of a write operation. The Server SDK is a single threaded design and it is highly highly recommended that callbacks are completed promptly in order to reduce server latency and jitter. Where the application performs activities in the callbacks that delay the server by milliseconds server latency and jitter as experienced by the client can be poor. For this reason write operations that complete over a serial line, backplane or other slow medium should be buffered in the application and completed asynchronously. Where it is feasible and desirable to complete a write within the callback this call can be made after UAServer_Perform_write() and before returning from the callback in order to modify the result of the write operation, for example setting a bad operation level result due to a write failure.
| [in] | write_context | A pointer to an opaque data structure providing context to the pending write operation. The user must pass this pointer to UA_Perform_write(). |
| [in] | result_code | If the write to the underlying system completed synchronously after the UAServer_Perform_write() call (i.e. that call only buffered the data prior to the actual physical write) then this parameter specifies the actual write operation level result code. The default result code populated during UAServer_Perform_write() would have been OpcUA_Good. |
| void UAServer_Callback_monitored_item | ( | uint32_t | node_handle, |
| uint32_t | monitored_item_id, | ||
| UA_Mon_Item_Callback_Operation_t | operation, | ||
| uint64_t | sampling_interval_ms | ||
| ) |
Function provided by host to enable library to indicate that a monitored item has been created for a variable node
Certain host systems may require notice from the library that a monitored item has been created or destroyed in order to maintain an internal cache of values or otherwise efficiently manage their read operations. This callback function enables a host to do so if it wishes but can be ignored if not required. Hosts must still be prepared to handle read callbacks for variables that are not being monitored (OPC-UA Read Service).
| [in] | node_handle | An identifier that the host can use to efficiently look up the value. |
| [in] | monitored_item_id | A unique identifier in the SDK for the monitored item. |
| [in] | operation | Indicates if a monitored item has been created, modified (for example had its sample rate change) or destroyed. |
| [in] | sampling_interval_ms | The sampling interval in milliseconds. |
| const UA_UTF8_string_t* UAServer_Callback_translate | ( | uint16_t | locale_index, |
| uint32_t | text_handle | ||
| ) |
Function provided by host to enable library to translate text
The library requires the ability to translate human readable text in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to get a pointer to the appropriate text for communication to a client using a specified and supported locale. This function is used to lookup translations for nodes created by the host system. A separate callback is used to lookup translations for internal text that the library uses to expose standard OPC-UA nodes in the address space.
| [in] | locale_index | The index into the previously provided locale table. Ignore if only one locale was provided. |
| [in] | text_handle | An identifier that the host can use to efficiently look up the text string. |
| const UA_UTF8_string_t* UAServer_Callback_translate_enumstrings | ( | uint16_t | locale_index, |
| uint32_t | enum_handle, | ||
| uint16_t | enum_index | ||
| ) |
Function provided by host to enable library to translate enumerated text
The library requires the ability to translate human readable text in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to get a pointer to the appropriate text for communication to a client using a specified and supported locale. This function is used to lookup translations for nodes created by the host system. A separate callback is used to lookup translations for internal text that the library uses to expose standard OPC-UA nodes in the address space.
MultiStateDiscrete Data Access address space nodes contain an enumeration of possible values with a human readable label for each value of the enumeration. When creating the node the host passes in a handle to the enumeration and the number of values. For translation the library calls this function indicating the enumeration handle provided and the index of the required label.
| [in] | locale_index | The index into the previously provided locale table. Ignore if only one locale was provided. |
| [in] | enum_handle | An identifier that the host can use to efficiently look up the enumeration. |
| [in] | enum_index | An index into the value of the enumeration indicating the label to be returned. |
| const UA_UTF8_string_t* UAServer_Callback_translate_internal_text | ( | uint16_t | locale_index, |
| uint32_t | text_index | ||
| ) |
Function provided by host to enable library to translate internal text
The library exposes some standard OPC-UA nodes in the server address space. It may be desirable to translate the DisplayNames of these nodes. This API callback is provided to facilitate translation of this text. If you do not wish to provide translation of the internal text, simply return the default English text to the library. If you do wish to provide translated text for the internal text you should implement tables of UTF8 strings for each supported locale. Note: There is no requirement in the OPC-UA standard to provide translations of the internal text even if your server supports multiple locales. In this case nodes you add to the address space will be localized but the standard OPC-UA nodes will not.
| [in] | locale_index | The index into the previously provided locale table. Ignore if no table was provided. |
| [in] | text_index | An identifier that the host can use to efficiently look up the text string (a zero based table index). |
| bool_t UAServer_Callback_login_username_password | ( | const UA_UTF8_string_t * | username, |
| const UA_UTF8_string_t * | password, | ||
| uint16_t * | user_index | ||
| ) |
Function provided by host to enable users to login
The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system. This function is called by the library to authenticate username/password combinations provided by a client when negotiating a session. The host maintains a table of valid user names and corresponding passwords. If the provided username & password authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.
| [in] | username | The user name provided. |
| [in] | password | The password provided. |
| [out] | user_index | The user index for this user. Must be set if function returns true. |
| bool_t UAServer_Callback_login_x509_certificate | ( | const UA_Byte_string_t * | certificate, |
| const UA_UTF8_string_t * | thumbprint, | ||
| uint16_t * | user_index | ||
| ) |
Function provided by host to enable users to login
The library optionally requires the ability to authenticate users in order to operate. This ability is provided by this function which must be implemented by the host system although it is only necessary to handle the callback if the host configures the SDK to support X509 certificates for user authentication.
This function is called by the library to authenticate X509V3 certificates provided by a client when negotiating a session. The host maintains a table of valid certificates. If the provided thumbprint authenticates successfully the host provides the library with a user index. The user index is a value from 1 to 15 indicating the user that has logged in. The user index provided by the host is used in conjunction with the node visibility bit mask to filter nodes visible to the current user.
The certificate is provided here purely as a convenience to hosts that are interested in it. Only the thumbprint is required to identify the certificate and authenticate a user.
This callback will only be executed if the certificate first validates for trust, content, etc. using the user certificate trust and issuer stores.
| [in] | certificate | The certificate provided by the client in DER format. |
| [in] | thumbprint | The certificate thumbprint. |
| [out] | user_index | The user index for this user. Must be set if function returns true. |
| void UAServer_Callback_File_Size | ( | uint32_t | node_handle, |
| uintptr_t | context | ||
| ) |
Function provided by host to enable file size to be reported
The function UAServer_File_Size_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_Open_result() to complete the operation. |
| UA_Status_t UAServer_File_Size_result | ( | uintptr_t | context, |
| uint64_t | size, | ||
| UA_Status_t | result | ||
| ) |
Function to complete file size operation
This function must be called within the body of function UAServer_Callback_File_Size() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_Size(). |
| [in] | size | The current size of the file in bytes. |
| [in] | result | 0 Success. Bad_UnexpectedError See Part 4 for a general description. Bad_NotFound See Part 4 for a general description. |
| void UAServer_Callback_File_Open | ( | uint32_t | node_handle, |
| uint8_t | mode, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable files to be opened
Open is used to open a file represented by an Object of FileType. When a client opens a file it gets a file handle that is valid while the session is open. Clients shall use the Close Method to release the handle when they do not need access to the file anymore. Clients can open the same file several times for read. A request to open for writing shall return Bad_NotWritable when the file is already opened. A request to open for reading shall return Bad_NotReadable when the file is already opened for writing.
The function UAServer_File_Open_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | mode | Indicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set. The mode is an 8-bit unsigned integer used as bit mask with the structure defined in the following table: |
Field Bit Description
Read 0 The file is opened for reading. If this bit is not set the Read Method cannot be executed.
Write 1 The file is opened for writing. If this bit is not set the Write Method cannot be executed.
EraseExisiting 2 This bit can only be set if the file is opened for writing (Write bit is set). The existing content of the file is erased and an empty file is provided.
Append 3 When the Append bit is set the file is opened at end of the file, otherwise at begin of the file. The SetPosition Method can be used to change the position.
Reserved 4:7 Reserved for future use. Shall always be zero..
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_Open_result() to complete the operation. |
| UA_Status_t UAServer_File_Open_result | ( | uintptr_t | context, |
| uint32_t | file_handle, | ||
| UA_Status_t | result | ||
| ) |
Function to complete file open operation
This function must be called within the body of function UAServer_Callback_File_Open() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_Open(). |
| [in] | file_handle | A handle for the file used in other method calls indicating not the file (this is done by the Object of the Method call) but the access request and thus the position in the file. The fileHandle is generated by the server and is unique for the Session. Clients cannot transfer the fileHandle to another Session but need to get a new fileHandle by calling the Open Method. |
| [in] | result | 0 Success. Bad_NotReadable See Part 4 for a general description. File might be locked and thus not readable. Bad_NotWritable See Part 4 for a general description. Bad_InvalidState See Part 4 for a general description. The file is locked and thus not writable. Bad_InvalidArgument See Part 4 for a general description. Mode setting is invalid. Bad_UnexpectedError See Part 4 for a general description. Bad_NotFound See Part 4 for a general description. |
| void UAServer_Callback_File_Close | ( | uint32_t | node_handle, |
| uint32_t | file_handle, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable files to be closed
Close is used to close a file represented by a FileType. When a client closes a file the handle becomes invalid.
The function UAServer_File_Close_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | file_handle | A handle indicating the access request and thus indirectly the position inside the file. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_Close_result() to complete the operation. |
| UA_Status_t UAServer_File_Close_result | ( | uintptr_t | context, |
| UA_Status_t | result | ||
| ) |
Function to complete file close operation
This function must be called within the body of function UAServer_Callback_File_Close() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_Close(). |
| [in] | result | 0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call. |
| void UAServer_Callback_File_Read | ( | uint32_t | node_handle, |
| uint32_t | file_handle, | ||
| int32_t | length, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable files to be read
Read is used to read a part of the file starting from the current file position. The file position is advanced by the number of bytes read.
The function UAServer_File_Read_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | file_handle | A handle indicating the access request and thus indirectly the position inside the file. |
| [in] | length | Defines the length in byte that should be returned in data, starting from the current position of the file handle. If the end of file is reached only all data till the end of the file are returned. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size are returned. Only positive values are allowed. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_Read_result() to complete the operation. |
| UA_Status_t UAServer_File_Read_result | ( | uintptr_t | context, |
| UA_Byte_string_t | data, | ||
| UA_Status_t | result | ||
| ) |
Function to complete file read operation
This function must be called within the body of function UAServer_Callback_File_Read() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_Read(). |
| [in] | data | The data to be read. |
| [in] | result | 0 Success. Bad_InvalidState See Part 4 for a general description. File was not opened for read access. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call or non positive length. Bad_UnexpectedError See Part 4 for a general description. |
| void UAServer_Callback_File_Write | ( | uint32_t | node_handle, |
| uint32_t | file_handle, | ||
| UA_Byte_string_t | data, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable files to be written
Write is used to write a part of the file starting from the current file position. The file position is advanced by the number of bytes written.
The function UAServer_File_Write_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | file_handle | A handle indicating the access request and thus indirectly the position inside the file. |
| [in] | data | Contains the data to be written at the position of the file. It is server-dependent whether the written data are persistently stored if the session is ended without calling the Close Method with the fileHandle. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_Write_result() to complete the operation. |
| UA_Status_t UAServer_File_Write_result | ( | uintptr_t | context, |
| UA_Status_t | result | ||
| ) |
Function to complete file write operation
This function must be called within the body of function UAServer_Callback_File_Write() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_Write(). |
| [in] | result | 0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call. Bad_NotWritable See Part 4 for a general description. File might be locked and thus not writable. Bad_InvalidState See Part 4 for a general description. File was not opened for write access. |
| void UAServer_Callback_File_GetPosition | ( | uint32_t | node_handle, |
| uint32_t | file_handle, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable file positions to be read
GetPosition is used to provide the current position of the file handle.
The function UAServer_File_GetPosition_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | file_handle | A handle indicating the access request and thus indirectly the position inside the file. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_GetPosition_result() to complete the operation. |
| UA_Status_t UAServer_File_GetPosition_result | ( | uintptr_t | context, |
| uint64_t | position, | ||
| UA_Status_t | result | ||
| ) |
Function to complete file open operation
This function must be called within the body of function UAServer_Callback_File_GetPosition() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_GetPosition(). |
| [in] | position | The position of the fileHandle in the file. If a Read or Write is called it starts at that position. |
| [in] | result | 0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call. |
| void UAServer_Callback_File_SetPosition | ( | uint32_t | node_handle, |
| uint32_t | file_handle, | ||
| uint64_t | position, | ||
| uintptr_t | context | ||
| ) |
Function provided by host to enable file positions to be written
SetPosition is used to set the current position of the file handle.
The function UAServer_File_SetPosition_result() must be called within this function body to complete the operation.
| [in] | node_handle | The handle of the FileType node identifying the file in the address space. |
| [in] | file_handle | A handle indicating the access request and thus indirectly the position inside the file. |
| [in] | position | The position to be set for the fileHandle in the file. If a Read or Write is called it starts at that position. If the position is higher than the file size the position is set to the end of the file. |
| [in] | context | A handle to the operation context which is passed to the library via UAServer_File_SetPosition_result() to complete the operation. |
| UA_Status_t UAServer_File_SetPosition_result | ( | uintptr_t | context, |
| UA_Status_t | result | ||
| ) |
Function to complete file set position operation
This function must be called within the body of function UAServer_Callback_File_SetPosition() to complete the operation.
| [in] | context | A handle to the operation context received from UAServer_Callback_File_SetPosition(). |
| [in] | result | 0 Success. Bad_InvalidArgument See Part 4 for a general description. Invalid file handle in call. |
| int64_t UAServer_Get_datetime | ( | void | ) |
Function provided by library to enable host to obtain current date and time
Where the library is using time emulation the callback function for DateTime is not used. THis function allows the host to obtain the date and time in use by the library in order to print accurate log messages as an aid to debugging.
| void UAServer_Time_emulation_enabled | ( | bool_t | enable | ) |
Enable time emulation mode
Call this function if the default (disabled) is unsuitable. When enabled, time emulation sets the server date & time from incoming client request packets in order to allow the server to operate with no date and time infrastructure implemented on the host system. In this case, UA_Get_datetime is not called.
| [in] | enable | Enable or disable time emulation mode |
| UA_Status_t UAServer_Initialise | ( | const UA_Configuration_t * | config | ) |
Initialise the library
This function returns OpcUa_Good if no errors are found during initialisation. If security is excluded from the build all errors are unrecoverable and the server will not start. If security is included in the build errors related to the application instance certificate are recoverable and the server will still start.
Specifically:
OpcUa_BadNoValidCertificates. An application instance certificate and private key are not found. The initialisation was successful but a certificate must be created or installed in order to proceed successfully.
OpcUa_BadSecurityChecksFailed. The application instance certificate failed validation for an undetermined reason (it may be corrupted). The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly.
OpcUa_BadCertificateTimeInvalid. The application instance certificate failed validation due to an invalid time (it may have expired). The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly. Also, operating the server with an expired certificate may be against your stated security policy.
OpcUa_BadCertificateRevoked. The application instance certificate failed validation because it has been revoked or because the CA CRL could not be found offline. The initialisation was successful but if a new certificate is not created or installed the server may not interoperate correctly. Also, operating the server with a revoked certificate may be against your stated security policy. It is possible that this error is generated due to initialising the server with an incorrect option bit configuration. To avoid this initialise the server before setting validation option bits.
| [in] | config | The requested server configuration data structure. |
| void UAServer_Terminate | ( | void | ) |
Terminate the library
Releases all resources allocated by the library. Not required to be called in a typical embedded environment.
| UA_Status_t UAServer_memory_info | ( | uint32_t * | total_memory_provided, |
| uint32_t * | memory_unusable, | ||
| uint32_t * | max_memory_used_this_run, | ||
| uint32_t * | total_memory_recommended | ||
| ) |
Get information about the memory utilisation
| [out] | total_memory_provided | The total memory provided to the SDK. |
| [out] | memory_unusable | The memory that is unusable due to the characteristics of the allocator. Modifying the amount of memory provided by this amount results in optimum efficiency. |
| [out] | max_memory_used_this_run | The maximum memory used since the server was started. |
| [out] | total_memory_recommended | The total memory recommended. This assumes that the server has been stressed to the maximum degree likely to be encountered in the field. The max_memory_used_this_run is multiplied by a 1.5 safety margin. total_memory_recommended is calculated based on the maximum amount of memory used by the server since initialisation. If the server memory utilisation has not been exercised to the maximum then the recommended figure is meaningless. Operating the server with less than total_memory_recommended bytes can result in failure over time due to exhaustion of the memory subsystem. |
| UA_Status_t UAServer_Set_URI | ( | const char * | uri | ) |
Set Server URI
The OPC-UA Server must be given a unique name or Universal Resource Identifier (URI). This name will be cached by clients that regularly connect to the server so for any particular device, the name must be constant. This name can be stored in non-volatile storage as a constant, or alternatively can be calculated dynamically during startup based on the machine MAC address or some other constant, unique value. The URI can be in any format. We recommend using the URN (Uniform Resource Name) UUID (Universally Unique IDentifier) format as follows: "urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66"
| [in] | uri | A null terminated ANSI C string containing the URI. |
| UA_Status_t UAServer_Start | ( | const char * | license | ) |
Start Server
Must be called in order to start the server.
| [in] | license | Some distributions require a license string in order to start. If your distribution does not require a license string simply provide a NULL pointer. |
| UA_Status_t UAServer_Stop | ( | void | ) |
Stop Server
Must be called in order to stop the server.
| UA_Server_state_t UAServer_Get_state | ( | bool_t * | shutdown_complete | ) |
Get Server State
Reads the current server state.
| [out] | shutdown_complete | If the server state is shutdown, the server may be in the process of shutting down. In this state this variable informs the host whether or not the shutdown is complete. |
| UA_Status_t UAServer_Generate_certificate | ( | void | ) |
Generate Application instance Certificate
The OPC-UA Server optionally requires an x509 application instance certificate. Version 1.02 of the OPC-UA Standard made this certificate optional for servers that do not support secure channels (x509 authentication and encryption) but for backward compatibility with OPC-UA Clients designed to version 1.01 of the standard it it is recommended to always generate a certificate. This certificate contains the server URI and server hostnames or IP addresses. If this information changes the server certificate must be regenerated by calling this function. This function creates a certificate including signing of the certificate using RSA encryption. This is a resource intensive operation so (depending on your platform) should only be done once during initialisation.
| UA_Status_t UAServer_Get_certificate_size | ( | uint32_t * | size_in_bytes | ) |
Read Application instance Certificate size
Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.
Provides the size of the generated certificate to facilitate the host application allocating sufficient memory to read out the certificate.
| [out] | size_in_bytes | The size of the generated certificate in bytes. |
| UA_Status_t UAServer_Read_certificate | ( | UA_Byte_string_t * | certificate | ) |
Read Application instance Certificate
Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.
Copies the generated certificate into the byte string provided.
| [out] | certificate | The generated certificate is copied into the preallocated byte string. |
| UA_Status_t UAServer_Write_certificate | ( | UA_Byte_string_t * | certificate | ) |
Write Application instance Certificate
Certificate generation via UAServer_Generate_certificate() is a resource intensive operation that can be very slow on some platforms. If the IP Address or Hostname of the server remains the same then the generated certificate will be the same each time. Instead of generating the certificate on every POST, the certificate can be generated (on a development system or on the target) once and then provided at POST in order to shorten boot time.
Copies the certificate from the byte string provided.
| [in] | certificate | The certificate is copied into the server from the byte string. |
| UA_Status_t UAServer_Add_IP_address | ( | uint8_t * | ip_address | ) |
Adds an IP address of a network interface
Where the target device does not have a Hostname, the stack requires the IP Address of the network interface in order to generate URI's and application instance certificates. Up to MAX_IP_ADDRESSES may be added. In general, IPAddresses should NOT be added where a Hostname has already been added.
| [in] | ip_address | A 4-byte long byte array containing the IP Address of the network interface. Example: "192.168.2.1" == { 0xC0, 0xA8, 0x02, 0x01 } |
| UA_Status_t UAServer_Clear_all_IP_addresses | ( | void | ) |
Clears the list of IP addresses
It is possible that when using DHCP, an IP Address may change during server operation. In this case the list of IP addresses must be cleared by calling this function followed immediately by one or more calls to UA_Tcpip_add_IP_address(). It is only required to use this function where the device has no Hostname and is using DHCP for IP Address assignment.
| UA_Status_t UAServer_Add_hostname | ( | const char * | hostname | ) |
Adds a Hostname of the device
Where the target device has a Hostname, the stack requires this name in order to generate URI's and application instance certificates. Up to MAX_HOSTNAMES may be added. IPAddresses should NOT be added where a Hostname has already been added.
| [in] | hostname | A null terminated ANSI C string containing the hostname. |
| UA_Status_t UAServer_Clear_all_hostnames | ( | void | ) |
Clears the list of host names
Host names rarely change. However, should a hostname change during server operation it is required to clear the internal list of names and immediately populate the list with the new name(s) using UA_Tcpip_add_hostname().
| UA_Status_t UAServer_New_connection | ( | uint64_t | connection_id | ) |
Informs the library that a new TCPIP connection has been made
Whenever a new TCPIP connection is made on the UA Server listening TCP PORT the host must call this function.
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| UA_Status_t UAServer_Connection_closed | ( | uint64_t | connection_id | ) |
Informs the library that a TCPIP connection has been terminated
Whenever a TCPIP connection is closed or aborted on the UA Server listening TCP PORT the host must call this function.
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| void UAServer_Callback_close_connection | ( | uint64_t | connection_id | ) |
Instructs the host application to close the socket
Whenever a TCP Binary connection is closed the library informs the host application to close the corresponding socket.
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| UA_Status_t UAServer_New_data_received | ( | void * | read_context, |
| uint64_t | connection_id | ||
| ) |
Informs the library that new data has been received
Whenever new data is received on an active TCPIP connection the host must call this function. The library responds by calling UAServer_Callback_data_receive()
| [in] | read_context | A pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Receive_data_callback(). |
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| bool_t UAServer_Callback_data_receive | ( | void * | application_context, |
| uint64_t | connection_id, | ||
| uint8_t * | buffer, | ||
| uint32_t | max_length_in_bytes, | ||
| uint32_t * | no_of_bytes_received | ||
| ) |
Read new data from TCP/IP stack
Whenever new data is received on an active TCPIP connection the library calls this function in response to UAServer_New_data_received()
| [in] | application_context | A pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_New_data_received(). |
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| [in] | buffer | A pointer to the data buffer |
| [in] | max_length_in_bytes | The maximum length of data to write into the buffer in bytes |
| [out] | no_of_bytes_received | The number of bytes read into the buffer |
| UA_Status_t UAServer_Get_data_to_send | ( | void * | write_context, |
| uint64_t | connection_id | ||
| ) |
Get queued data to send from the library
When the library has data queued for transmission this function is called in order to send the queued data. The library responds by calling UAServer_Callback_data_send()
| [in] | write_context | A pointer to an application specific data structure providing context to the pending read operation. The library will pass this pointer to UAServer_Send_data_callback(). |
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| bool_t UAServer_Callback_data_send | ( | void * | application_context, |
| uint64_t | connection_id, | ||
| uint8_t * | buffer, | ||
| uint32_t | no_of_bytes_to_send, | ||
| uint32_t * | no_of_bytes_sent | ||
| ) |
Send new data to TCP/IP stack
The library calls this function in response to UAServer_Get_data_to_send()
| [in] | application_context | A pointer to an application specific data structure providing context to the pending read operation. The host must pass this pointer to UAServer_Get_data_to_send(). |
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| [in] | buffer | Pointer to the buffer containing the data to send |
| [in] | no_of_bytes_to_send | The length of data available to send in bytes |
| [out] | no_of_bytes_sent | The number of data bytes sent. If this number equals the no_of_bytes_to_send the library may call the function again to send more data if available. |
| UA_Status_t UAServer_Ready_to_receive | ( | uint64_t | connection_id, |
| bool_t * | result | ||
| ) |
Can the connection receive any more data at present
| [in] | connection_id | A unique identifier for this TCPIP connection. Where a socket API is in use the socket file descriptor may be used. Where a raw API is in use a value representing the remote endpoint may be used. |
| [out] | result | True if the server can receive more data. |
| void UAServer_Poll | ( | void | ) |
Poll library periodically
The library must be polled at the cyclic rate specified in the configuration data structure. No checking is performed internally on timing so the timing behaviour of the server is directly dependent on the accuracy of polling by the application.
| UA_Status_t UAServer_Delete_all_nodes | ( | void | ) |
Delete all host generated nodes in the address space
Allows the host system to remove all nodes from the address space that it has previously added.
| UA_Status_t UAServer_Delete_node | ( | uint32_t | node_handle | ) |
Delete a specific host generated node from the address space
Allows the host system to remove a specific node from the address space that it has previously added. This function requires additional memory to execute and cannot be performed in the minimal 45kB buffer footprint. Required memory footprint varies but is typically of the order of 5kB to enable this feature for the minimal implementation.
| [in] | node_handle | The handle of the node to be deleted |
| void UAServer_Init_config_structure_Folder | ( | UA_Folder_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_Folder | ( | const UA_Folder_t * | configuration | ) |
Create a folder node that will contain (or reference) other nodes
Allows the host system to create a folder node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_View | ( | UA_View_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_View | ( | const UA_View_t * | configuration | ) |
Create a view node that will contain (or reference) other nodes
Allows the host system to create a view node in the address space. The library supports 15 different views. Each view created will be given a view index of 1 - 15 in the order in which they are created. The view index is used in conjunction with view masks that can be specified for references. See the library user manual for more information about views. A created view is automatically added to the Views folder of the address space.
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_Method | ( | UA_Method_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_Method | ( | const UA_Method_t * | configuration | ) |
Create a method node
Allows the host system to create a method node in the address space. While method nodes can be created they are not functionally supported by the library at present.
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_BaseDataVariable | ( | UA_BaseDataVariable_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_BaseDataVariable | ( | const UA_BaseDataVariable_t * | configuration | ) |
Create a BaseDataVariable node
Allows the host system to create a BaseDataVariable node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_DataItem | ( | UA_DataItem_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_DataItem | ( | const UA_DataItem_t * | configuration | ) |
Create a DataItem node
Allows the host system to create a DataItem node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_AnalogItem | ( | UA_AnalogItem_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_AnalogItem | ( | const UA_AnalogItem_t * | configuration | ) |
Create an AnalogItem node
Allows the host system to create an AnalogItem node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_TwoStateDiscrete | ( | UA_TwoStateDiscrete_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_TwoStateDiscrete | ( | const UA_TwoStateDiscrete_t * | configuration | ) |
Create a TwoStateDiscrete node
Allows the host system to create a TwoStateDiscrete node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_MultiStateDiscrete | ( | UA_MultiStateDiscrete_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_MultiStateDiscrete | ( | const UA_MultiStateDiscrete_t * | configuration | ) |
Create a MultiStateDiscrete node
Allows the host system to create a MultiStateDiscrete node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| void UAServer_Init_config_structure_File | ( | UA_File_t * | configuration | ) |
Initialise a configuration structure for a new node with default values
In order to add create a node in the address space, the host system must configure a configuration structure for the node and then call the appropriate 'Create' function. This function initializes a node configuration structure to default values prior to configuring the structure and calling the 'Create' function.
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Create_File | ( | const UA_File_t * | configuration | ) |
Create a File node
Allows the host system to create a File node in the address space
| [in] | configuration | A pointer to the configuration data structure for the node |
| UA_Status_t UAServer_Add_to_folder | ( | uint32_t | folder_handle, |
| uint32_t | node_handle | ||
| ) |
Add a node to a folder node
Allows the host system to add a previously created node to a folder. Specifically this creates a reference from the folder node to the target node.
| [in] | folder_handle | The handle of the folder node (source node of the reference) |
| [in] | node_handle | The handle of the node to add to the folder (target node of the reference) |
| UA_Status_t UAServer_Add_to_folder_with_view_mask | ( | uint32_t | folder_handle, |
| uint32_t | node_handle, | ||
| uint16_t | view_mask | ||
| ) |
Add a node to a folder node while specifying a view mask
Allows the host system to add a previously created node to a folder. Specifically this creates a reference from the folder node to the target node. This function allows the host to specify a view mask. This filters the visibility of the reference depending on the view being browsed by the client.
| [in] | folder_handle | The handle of the folder node (source node of the reference) |
| [in] | node_handle | The handle of the node to add to the folder (target node of the reference) |
| [in] | view_mask | A bit mask with a bit set for each view where the reference is visible. Bit zero is no view and bits 1 - 15 are the 15 supported views. |
| UA_Status_t UAServer_Add_to_objects_folder | ( | uint32_t | node_handle | ) |
Add a node to the objects folder
Allows the host system to add a previously created node to the objects folder. Specifically this creates a reference from the objects folder node to the target node. The objects folder is a standard object that is always present in the address space.
| [in] | node_handle | The handle of the node to add to the objects folder (target node of the reference) |
| void UAServer_Callback_log | ( | UA_Log_severity_t | severity, |
| int64_t | timestamp, | ||
| const char * | file_name, | ||
| uint32_t | line_number, | ||
| UA_Log_payload_t | payload_type, | ||
| const void * | payload, | ||
| uint32_t | payload_length | ||
| ) |
A log message from the server stack
Supports debugging of a server implementation.
| [in] | severity | The severity of the log event |
| [in] | timestamp | The timestamp of the event |
| [in] | file_name | The source filename of the file generating the event |
| [in] | line_number | The source line number of the file generating the event |
| [in] | payload_type | The type of the payload accompanying the log event |
| [in] | payload | A pointer to payload related to the log event |
| [in] | payload_length | The length of the payload related to the log event |
| void UAServer_Printf | ( | int64_t | timestamp, |
| const char * | format, | ||
| ... | |||
| ) |
A printf message from the server stack
Supports debugging of a server implementation.
| [in] | timestamp | The timestamp of the message |
| [in] | format | Message format string |
| [in] | ... | Variable argument list |
| void* UAServer_Malloc | ( | size_t | size | ) |
Allocate a block of memory from the SDK memory allocation subsystem
If the application needs to perform dynamic memory allocation it can use the SDK memory allocation subsystem rather than a general purpose heap (which in any case may not be available). The allocation must be less than the maximum allocation size specified in the configuration (typically by 8 bytes).
| [in] | size | The size in bytes of the required block of memory. |
| void* UAServer_Calloc | ( | size_t | size | ) |
Allocate a block of memory from the SDK memory allocation subsystem and zero the block
| [in] | size | The size in bytes of the required block of memory. |
| void* UAServer_Realloc | ( | void * | ptr, |
| size_t | size | ||
| ) |
Increase or decrease the size of a previously allocates a block of memory from the SDK memory allocation subsystem.
| [in] | ptr | A pointer previously returned by one of the memory allocation routines. |
| [in] | size | The size in bytes of the required block of memory. |
| void UAServer_Free | ( | void * | ptr | ) |
Free a memory block previously allocated with UAServer_Malloc(), UAServer_Calloc() or UAServer_Realloc().
| [in] | ptr | The pointer previously returned by one of the memory allocation routines. |
| UA_Status_t UASecurity_Check_application_certificate_exists | ( | void | ) |
Check if the application certificate and corresponding private key are present.
If there is no application certificate present the application may choose to create a default self signed certificate if certificate creation functionality is supported by the PKI component.
| UA_Status_t UASecurity_Create_self_signed_certificate | ( | const UA_Configuration_t * | sdk_configuration, |
| const char * | server_uri, | ||
| const char ** | hostnames, | ||
| int | no_of_hostnames, | ||
| const char ** | ip_addresses, | ||
| int | no_of_ip_addresses | ||
| ) |
Create a self signed certificate.
| [in] | sdk_configuration | The configuration structure used to initialise the SDK. |
| [in] | server_uri | The server URI. |
| [in] | hostnames | The array of hostnames assigned to the host that the server is running on that the server is accessible from. |
| [in] | no_of_hostnames | The number of hostnames. |
| [in] | ip_addresses | The array of ip addresses assigned to the host that the server is running on that the server is accessible from. If hostnames are available IP addresses should not be used. |
| [in] | no_of_ip_addresses | The number of IP addresses. |
| UA_Status_t UASecurity_Reload_directory_stores_now | ( | void | ) |
Reload the directory certificate stores.
If the PKI component stores certificates in the filesystem it may load the certificates only once on startup. If a certificate is added the application may wish the PKI compnent to reload the stores from the filesystem following the addition.
| void UASecurity_Reload_directory_stores_before_each_validation | ( | bool_t | enable | ) |
Reload the directory certificate stores before every certificate validation.
If the PKI component stores certificates in the filesystem it may load the certificates only once on startup. If it is possible for certificates to be added or removed from the filesystem at any time and independently of the application the application should instruct the PKI component to reload certificates from the filesystem prior to every validation.
| [in] | enable | enable or disable reloading. |
| UA_Status_t UASecurity_Create_directory_stores | ( | void | ) |
Create the directory certificate stores.
Create the filesystem structure required for the certificate stores. There are four certificate stores. There are trusted and issuer stores for both application and user certificates.
| void UASecurity_Set_validation_options | ( | uint32_t | option_bits | ) |
Alter the behaviour of the certificate validation logic.
| [in] | option_bits | Bitmap defining the behaviour required. |
| UA_Status_t UASecurity_Get_thumbprint | ( | const char * | filepath, |
| char * | thumbprint, | ||
| uint32_t | thumbprint_max_length | ||
| ) |
Get the certificate thumbprint.
When storing certificates in a filesystem programmatically the SHA1 thumbprint should be used as the filename for the certificate with the .DER file extension. This ensures that all certificates shall have a unique filename. The OpenSSL PKI component does not make use of this file naming convention but other PKI components may depend on it for correct operation.
| void UASecurity_Callback_get_private_key_password | ( | UA_Var_string_t * | password | ) |
Provide the password for the application certificate private key file.
| [out] | password | The password for the private key PEM file. |
| void UASecurity_Callback_certificate_added_to_rejected_list | ( | UA_Certificate_Type_t | type | ) |
A certificate was added to the rejected certificate list.
| [in] | type | The type of the certificate. |